<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/css/app.css">
    <title>Document</title>
</head>
<body>


{{--父级模板，起到加载公共模板的作用--}}
<div class="container">
    <nav class="navbar navbar-expand-lg  navbar-dark bg-dark">
        <a class="navbar-brand" href="#">首页</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item active">
                    <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
                </li>
                <li class="nav-item">

                    {{--user.表示user下面的什么社么方法--}}
                    <a class="nav-link active" href="{{route("user.index")}}">用户列表</a>
                </li>
            </ul>
            <form class="form-inline my-2 my-lg-0">

                {{--判断用户是否登录--}}
                @if(Auth::check())

                    <a href="{{route("password")}}" class="btn btn-outline-success my-2 my-sm-0 mr-2 " type="submit">{{Auth::user()->name}}</a>
                    <a href="{{route("logout")}}" class="btn btn-outline-success my-2 my-sm-0" >退出登录</a>

                    @else

                    <a href="{{route("register")}}" class="btn btn-outline-success my-2 my-sm-0 mr-2 " type="submit">登录</a>
                    <a href="{{route("index")}}" class="btn btn-outline-success my-2 my-sm-0" type="submit">注册</a>

                @endif
                {{--<a href="/hdcms" class="btn btn-outline-success my-2 my-sm-0 mr-2 " type="submit">登录</a>--}}

            </form>
        </div>
    </nav>

    {{--使用@yield占位符，子模板想要加载就需要先继承父级模板，然后使用@section代替占位符--}}
    {{--这样就做到了头不变，底变的效果--}}
    @include("public._message")
    @yield("content")

</div>



</body>
</html>
